home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / DMAKE38B.ARJ / DIRLIB.H < prev    next >
C/C++ Source or Header  |  1992-01-23  |  1KB  |  43 lines

  1. /* DIRLIB.H by M. J. Weinstein   Released to public domain 1-Jan-89 */
  2.  
  3. #ifndef _DIRLIB_h_
  4. #define _DIRLIB_h_
  5.  
  6. #include <stdio.h>
  7. #include "stdmacs.h"
  8.  
  9. #define MAXNAMLEN   15
  10.  
  11. struct direct {
  12.    long              d_ino;
  13.    unsigned short    d_reclen;
  14.    unsigned short    d_namlen;
  15.    char              d_name[MAXNAMLEN+1];
  16. };
  17.  
  18. typedef struct {
  19.    char   fcb[21];
  20.    char   attr;
  21.    short  time;
  22.    short  date;
  23.    long   size;
  24.    char   name[13];
  25. } DTA;
  26.  
  27. typedef struct {
  28.    DTA    dd_dta;       /* disk transfer area for this dir.        */
  29.    short  dd_stat;      /* status return from last lookup          */
  30.    char   dd_name[1];   /* full name of file -- struct is extended */
  31. } DIR;
  32.  
  33. extern DIR           *opendir   ANSI((char *));
  34. extern struct direct *readdir   ANSI((DIR *));
  35. extern long          telldir    ANSI((DIR *));
  36. extern void          seekdir    ANSI((DIR *, long));
  37. extern void          closedir   ANSI((DIR *));
  38. extern DTA           *findfirst ANSI((char *, DTA *));
  39. extern DTA           *findnext  ANSI((DTA *));
  40.  
  41. #define rewinddir(dirp)   seekdir(dirp,0L)
  42. #endif
  43.